#include<stdio.h>
#include<string.h>
#define maxn 404
const int dx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int dy[] = {1, 2, 2, 1, -1, -2, -2, -1};
int n, m, X, Y;
int p[maxn][maxn];
typedef struct {int x, y, s;}P;
#define len 200000
int ql, qr;
P q[len];
void push(int x, int y, int s) {
  P t = {x, y, s};
  int qt = qr;
  qr=(qr+1)%len;
  q[qt]=t;
}
P pop() {
  int qt = ql;
  ql=(ql+1)%len;
  return q[qt];
}
int empty() {return ql==qr;}
void clear() {ql=qr=0;}
void show() {
  for(int i=1; i<=n; ++i) {
    for(int j=1; j<=m; ++j) {
      printf("%-5d", p[i][j]);
    }
    putchar('\n');
  }
}
int main() {
  memset(p, -1, sizeof(p));
  scanf("%d%d%d%d", &n,&m,&X,&Y);
  push(X, Y, 0);
  while(!empty()) {
    P cur = pop();
    int x = cur.x, y=cur.y, s=cur.s;
    p[x][y] = s;
    for(int i=0; i<8; ++i) {
      int nx=x+dx[i], ny=y+dy[i];
      if(!(nx<=0||ny<=0||nx>n||ny>m||p[nx][ny]!=-1))
        push(nx, ny, s+1);
    }
  }
  show();
}

